﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MudEngine.Parsing.AST
{
    public class WhileStatement : Statement
    {
        public Expression Condition { get; private set; }
        public Statement Statement {get; private set; }

        public WhileStatement(Expression condition, Statement statement)
        {
            this.Condition = condition;
            this.Statement = statement;
        }

        public override void AcceptVisitor<C>(IAstNodeVisitor<C> visitor, C ctx)
        {
            visitor.VisitWhileStatement(this, ctx);
        }
    }

	public class DoWhileStatement : WhileStatement
	{
		public DoWhileStatement(Statement statement, Expression condition) : base(condition, statement) { }

		public override void AcceptVisitor<C>(IAstNodeVisitor<C> visitor, C ctx)
		{
			visitor.VisitDoWhileStatement(this, ctx);
		}
	}
}
